home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-01
/
pdcurs21.zip
/
PORTABLE.ZIP
/
WERASE.C
< prev
next >
Wrap
Text File
|
1992-11-21
|
2KB
|
67 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#undef werase
#ifndef NDEBUG
char *rcsid_werase = "$Header: c:/curses/portable/RCS/werase.c%v 2.0 1992/11/15 03:29:07 MH Rel $";
#endif
/*man-start*********************************************************************
werase() - copy blanks into window
X/Open Description:
These functions copy blanks to every position in the window.
NOTE: erase() is a macro.
PDCurses Description:
There is no additional PDCurses functionality.
X/Open Return Value:
These functions return OK on success and ERR on error.
PDCurses Errors:
It is an error to call this function with a NULL window pointer.
Portability:
PDCurses int werase( WINDOW* win );
X/Open Dec '88 int werase( WINDOW* win );
BSD Curses int werase( WINDOW* win );
SYS V Curses int werase( WINDOW* win );
**man-end**********************************************************************/
int werase(WINDOW *win)
{
chtype* end;
chtype* start;
int y;
static chtype blank;
if (win == (WINDOW *)NULL)
return( ERR );
blank = win->_blank | win->_attrs;
for (y = win->_tmarg; y <= win->_bmarg; y++)
{
start = win->_y[y];
end = &start[win->_maxx - 1];
/* changed JGB 6/92 < to <= */
while (start <= end)
{
*start++ = blank;
}
win->_firstch[y] = 0;
win->_lastch[y] = win->_maxx - 1;
}
win->_cury = win->_tmarg;
win->_curx = 0;
return( OK );
}